{extend name="public/info_base"}

{block name="title"}
湖南省酒业协会 - 活动确认
{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/summary.css">
<link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
<style>
    .layui-btn {
        margin-bottom: 20px;
    }
    @media screen and (max-width: 500px) {
        .main_detail {
            width: auto;
            font-size: 14px;
        }
    }
    .layui-input {
        height: 30px;
    }
    .sex{
        top:0.5rem;
    }
</style>
{/block}

{block name="body"}
<div class="articleList-big">
    {include file="public/header" /}
    {include file="public/nav" /}
    {include file="public/banner" /}
    <div class="main">
        <div class="summary_lf">
            <ul>
                <li class="bg-9d">活动确认</li>

                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
            </ul>
        </div>
        <div class="summary_rt">
            <div class="summary_rt_a">
                <div class="toRight"></div>
                <div class="summary_rt_top">
                    <span class="top_san"></span>
                    <span>当前位置 : </span>
                    <span>首页 </span>
                    <span class="cl-9d">&gt;  活动确认 </span>
                </div>
            </div>
            <!--常规-->
            <div class="top_two active">
                <span class="top_two_img"></span>
                <span class="cl-9d">活动确认</span>
            </div>
            <div class="main_detail">
                <div class="title">
                    <h2>{$data.title}</h2>
                </div>

                <div class="content">

                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="name" name="enterprise" lay-verify="required" placeholder="姓名" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block sex">
                                <input type="radio" name="item" value="男" title="男" checked="" >男
                                <input type="radio" name="item" value="女" title="女" >女
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">单位：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="unit" name="duty" lay-verify="required" autocomplete="off" placeholder="单位" class="layui-input">
                            </div>
                        </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">职务：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="duty" name="duty" lay-verify="required" autocomplete="off" placeholder="单位" class="layui-input">
                        </div>
                    </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">电话号码：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="tel" name="mobile" lay-verify="mobile" autocomplete="off" placeholder="电话号码" class="layui-input">
                            </div>
                        </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">会务费：</label>
                        <div class="layui-input-block">
                            <input type="radio" name="fee" value="500" title="会务费" checked="" >(含住宿)500
                            <input type="radio" name="fee" value="200" title="会务费" >(不含住宿)200
                        </div>
                    </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="activity_id" value="{$data.id}">
                                <button class="layui-btn" id="quedin" type="submit">立即提交</button>
                            </div>
                        </div>

                </div>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    {include file="public/footer" /}
</div>
<div class="articleList-little">
    <div class="articleList-little_top">
        <span>湖南酒业 </span>
        <span class="cl-9d">&gt;  活动确认 </span>
    </div>
    <div class="main_detail">
        <div class="title">
            <h2>
                {$data.title}
            </h2>
        </div>
        <div class="content">

                <div class="layui-form-item">
                    <label class="layui-form-label">姓名：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="name1" name="enterprise" lay-verify="required" placeholder="姓名" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">性别：</label>
                    <div class="layui-input-block sex">
                        <input type="radio" name="item" value="男" title="男" checked="">男
                        <input type="radio" name="item" value="女" title="女" >女
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单位：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="unit1" name="duty" lay-verify="required" autocomplete="off" placeholder="单位" class="layui-input">
                    </div>
                </div>
            <div class="layui-form-item">
                <label class="layui-form-label">职务：</label>
                <div class="layui-input-inline">
                    <input type="text" id="duty1" name="duty" lay-verify="required" autocomplete="off" placeholder="单位" class="layui-input">
                </div>
            </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">电话号码：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="tel1" name="mobile" lay-verify="mobile" autocomplete="off" placeholder="电话号码" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="hidden" name="activity_id" value="{$data.id}">
                        <button class="layui-btn" id="quedin1" type="submit">立即提交</button>
                    </div>
                </div>

        </div>

        <div style="width: 7rem; height:7rem; display: block; margin: 1rem auto;" >
            <img src="__STATIC__/home/images/top5.png"/>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<script src="__STATIC__/layui/build/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    $(function () {

        $("#quedin").click(function (){
            var name = $("#name").val();

            var sex = $("input[name='item']:checked").val();
            var unit = $("#unit").val();
            var duty = $("#duty").val();
            var tel = $("#tel").val();
            if(name ==''||sex==''||unit==''||duty==''){
                alert("请填写完整信息");
            }
            re= /^0?(13|14|15|17|18)[0-9]{9}$/
            if(!re.test(tel)){
                alert('请填写正确的电话号码');return;
            }
            $.ajax({
                type:'post',
                data:{name:name,sex:sex,unit:unit,duty:duty,tel:tel},
                url:'/Index/activity/insertfbh',
                success:function(data){

                    info = JSON.parse(data);
                    if(info.code==1){
                        alert('报名成功');

                    }else if(info.code ==-1){
                        alert('该电话已存在');
                    }else{
                        alert('报名失败');
                    }
                }
            })
        });
        $("#quedin1").click(function (){
            var name = $("#name1").val();
            var sex = $("input[name='item']:checked").val();
            var unit = $("#unit1").val();
            var duty = $("#duty1").val();
            var tel = $("#tel1").val();

            if(name ==''||sex==''||unit==''||duty==''){
                alert("请填写完整信息");
            }
            re= /^0?(13|14|15|17|18)[0-9]{9}$/
            if(!re.test(tel)){
                alert('请填写正确的电话号码');return;
            }
            $.ajax({
                type:'post',
                data:{name:name,sex:sex,unit:unit,duty:duty,tel:tel},
                url:'/index/activity/insertfbh',
                success:function(data){

                    info = JSON.parse(data);
                    if(info.code==1){
                        alert('报名成功');

                    }else if(info.code ==-1){
                        alert('该电话已存在');
                    }else{
                        alert('报名失败');
                    }
                }
            })
        });
    });
</script>
{/block}